﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title>External interface demo</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style type="text/css" media="screen">
		html, body { height:100%; background-color: #ffffff;}
		body { margin:0; padding:0; overflow:hidden; }
		#flashContent { width:100%; height:100%; }
		</style>

    <script src="../shuobject.js"></script>

	</head>

	<body>
    <h1>The external interface simulation in the shuobject.</h1>
    <!-- see also examples/external/externalinterface/ -->

<script>
  shuobject.embedSWF('external_interface.swf', 'avm2', 550, 400, '9,0,10', null, {}, {}, {}, function (e) {
    console.log('Object loaded, success=' + e.success);
  });
</script>


<script>
var swf;
function isReady()
{
	return true;
}
function jsFunction1()
{
	alert("from Flash");
}
function jsFunction2()
{
	return "from JavaScript";
}
function callFlash()
{
	swf = document.getElementById("avm2");
	swf.fromJS("This is also from JavaScript");
}
</script>

<div><button type="button" onclick="callFlash()">Click Me</button></div>
<div>Click the button on the left to call a function in the SWF.</div>


<div id="flashContent">
  <div id="avm2"></div>
</div>

	</body>
</html>
